home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / lib / unix / getwd.c < prev    next >
C/C++ Source or Header  |  1997-09-09  |  420b  |  27 lines

  1.  
  2. /*
  3.  *  GETWD.C
  4.  *
  5.  *    (c)Copyright 1992-1997 Obvious Implementations Corp.  Redistribution and
  6.  *    use is allowed under the terms of the DICE-LICENSE FILE,
  7.  *    DICE-LICENSE.TXT.
  8.  */
  9.  
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <string.h>
  13. #include <errno.h>
  14.  
  15. char *
  16. getwd(buf)
  17. char *buf;
  18. {
  19.     char *path;
  20.  
  21.     if (path = getcwd(buf, 256))
  22.     return(path);
  23.     strcpy(buf, strerror(errno));
  24.     return(NULL);
  25. }
  26.  
  27.